package router

import (
	"cam-master/handler"
	"github.com/gin-gonic/gin"
	"net/http"
)

func Init() *gin.Engine {

	r := gin.Default()

	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})
	r.POST("create", handler.CreateComputer)
	r.GET("list", handler.ListComputer)
	r.POST("upload", handler.UploadFile)
	r.Static("/upload", "./upload")
	r.GET("info")
	return r
}
